

const header = {
	"tenant-id": "1",
	// 设置后端需要的传参类型
	"Content-Type": "application/json",
	// Authorization: "Bearer " + uni.getStorageSync("clientAccessToken"),
	Authorization: "Bearer " + '7606cd9099814eb1a022c954eff2595c',
	//   clientId: "8fc0edeb27d9154f54f69ae1fa10ec65",
	// "X-Requested-With": "XMLHttpRequest",
	withCredentials: false,
	terminal: 1,
}

const request = (url = '', data = {} ,method = 'GET') => {
	return new Promise((resolve, reject) => {
		uni.request({
			url: "http://192.168.0.151:48080"+url,
			header: header,
			data: data,
			// params:params,
			method: method,
			success: (res) => {
				resolve(res)
			},
			fail: (err) => {
				reject(err)
			}
		})
	})
}

export default request